package StudyCode.summary.mycollection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class UnionToArrayList {
	public static <T> List<T> unionToArrayList(final Collection<T> collection, final T... items) {
		final ArrayList<T> result = new ArrayList<T>(collection.size()
				+ items.length);
		result.addAll(collection);
		Collections.addAll(result, items);
		return result;
	}
}
